var express = require('express');
var router = express.Router();
//引入Query.js连接数据库
const Query = require('../tools/Query')
//设置视频播放端口
router.get('/videoplay',async (req,res)=>{
    let {id} = req.query
    //查询数据库
    let videoplay = `SELECT * FROM e_video WHERE '${id}'`
    let [err,result] = await Query(videoplay)
    //设置空对象接收数据
    let data = {}
    //判断是否错误
    if(!err){
        data = {
            msg:'ok',
            code:200,
            result
        }
    }else{
        data = {
            msg:err
        }
    }
    //展示数据
    res.send(data)
})

module.exports = router;
